package com.zzh.framework;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author：zhangzhanheng
 * @createTime: 2021/8/3  8:20 下午
 * @desc: 注册中心demo
 * @version: 1.0.0
 **/
public class RemoteMapRegister {
    private static Map<String, List<URL>> REGISTER = new HashMap<>();

    public static void register(String interfaceName,URL url) {
        List<URL> urlList = REGISTER.get(interfaceName);
        if (urlList == null) {
            urlList = new ArrayList<>();
        }
        urlList.add(url);
        REGISTER.put(interfaceName,urlList);

    }

    public static List<URL> get(String interfaceName) {
        List<URL> urls = REGISTER.get(interfaceName);
        return urls;
    }

}
